package bank.savingspassbook.vo;

import java.io.Serializable;
import java.util.Calendar;

import bank.passbook.vo.Passbook;

/**
 * @author user
 *
 */
public class SavingsPassbook extends Passbook implements Serializable{
	private String expiryDate;
	public SavingsPassbook() {	}
	public SavingsPassbook(String accountNumber, String owner, int money, String createDate, double interest, String expiryDate) {
		super(accountNumber, owner, money, createDate, interest);
		this.expiryDate = expiryDate;
	}
	
	public String getExpiryDate() {
		return expiryDate;
	}
	
	public void setExpiryDate(String expiryDate) {
		this.expiryDate = expiryDate;
	}
	
	@Override
	public String toString() {
		return "SavingsPassbook [expiryDate=" + expiryDate + ", toString()="
				+ super.toString() + "]";
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((expiryDate == null) ? 0 : expiryDate.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		SavingsPassbook other = (SavingsPassbook) obj;
		if (expiryDate == null) {
			if (other.expiryDate != null)
				return false;
		} else if (!expiryDate.equals(other.expiryDate))
			return false;
		return true;
	}
}
